package com.skyworth.${package.ModuleName}api.api;

import com.skyworth.${package.ModuleName}api.pojo.dto.${entity?lower_case}.req.*;
import com.skyworth.${package.ModuleName}api.pojo.dto.${entity?lower_case}.res.*;
import com.skyworth.core.pojo.dto.PageResDTO;
import com.skyworth.core.pojo.dto.ResDTO;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * <p>
 * ${table.comment!} 模块API
 * </p>
 *
 * @author ${author}
 * @since ${date}
 */
public interface ${entity}Api  {

    /**
    * 查询分页数据
    */
    @PostMapping(value = "/${table.entityPath}/list", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
     ResDTO<PageResDTO<${entity}ListResDTO>> list(@RequestBody ${entity}ListReqDTO ${entity?uncap_first}ListReqDTO);

    /**
    * 根据id查询
    */
    @PostMapping(value = "/${table.entityPath}/get/{id}", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
     ResDTO<${entity}GetResDTO> get(@PathVariable("id") Long id);

    /**
    * 新增
    */
    @PostMapping(value = "/${table.entityPath}/add", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
     ResDTO<Void> add(@RequestBody ${entity}AddReqDTO ${entity?uncap_first}AddReqDTO);

    /**
    * 删除
    */
    @PostMapping(value = "/${table.entityPath}/del/{ids}", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
     ResDTO<Void> delete(@PathVariable("ids") List<Long> ids);

    /**
    * 修改
    */
    @PostMapping(value = "/${table.entityPath}/update", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
     ResDTO<Void> update(@RequestBody ${entity}UpdateReqDTO ${entity?uncap_first}UpdateReqDTO);
}